<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="PagosCreateDlg" widgetVar="PagosCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreatePagosTitle}">

            <h:form id="PagosCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{pagosController.selected != null}">

                        <p:outputLabel value="#{bundle.CreatePagosLabel_fecha}" for="fecha" />
                        <p:calendar id="fecha" pattern="MM/dd/yyyy" value="#{pagosController.selected.fecha}" title="#{bundle.EditPagosTitle_fecha}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreatePagosLabel_monto}" for="monto" />
                        <p:inputText id="monto" value="#{pagosController.selected.monto}" title="#{bundle.CreatePagosTitle_monto}" />

                        <p:outputLabel value="#{bundle.CreatePagosLabel_cuotasACobrar}" for="cuotasACobrar" />
                        <p:selectOneMenu id="cuotasACobrar" value="#{pagosController.selected.cuotasACobrar}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{cuotasACobrarController.items}"
                                           var="cuotasACobrarItem"
                                           itemValue="#{cuotasACobrarItem}"
                                           itemLabel="#{cuotasACobrarItem.cuotasACobrarPK.toString()}"
                                           />
                            <f:converter binding="#{cuotasACobrarConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.CreatePagosLabel_codCliente}" for="codCliente" />
                        <p:selectOneMenu id="codCliente" value="#{pagosController.selected.codCliente}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{clientesController.items}"
                                           var="codClienteItem"
                                           itemValue="#{codClienteItem}"
                                           itemLabel="#{codClienteItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{clientesConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{pagosController.saveNew}" value="#{bundle.Save}" update="display,:PagosListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,PagosCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="PagosCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
